<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<jsp:include page="../frame/header.jsp"></jsp:include>

<title>编辑版主</title>
<style>
#picture{
	position:absolute;
	left:600px;
	top:200px;
}
</style>

</head>

<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<div>
				<ul class="breadcrumb">
					<li><a href="#">娱乐交友</a> <span class="divider">/</span></li>
					<li><a href="#">曼大BBS</a></li>
				</ul>
			</div>

			<div class="box">
				<div class="box-header well" data-original-title>
					<h2>
						编辑版主- 【${forum.name }】
					</h2>
					<div class="box-icon">
						<a href="#" class="btn btn-setting btn-round"><i
							class="icon-cog"></i></a> <a href="#"
							class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						<a href="#" class="btn btn-close btn-round"><i
							class="icon-remove"></i></a>
					</div>
				</div>
				<div class="box-content">
					<form id="myform" class="form-inline" method="post" action="<c:url value="/admin/forum/moderator" />">
					<table id="info" class="table table-striped ">
						<thead>
							<tr>
								<th>显示顺序</th>
								<th>用户名</th>
								<th>用户组</th>
								<th>由上级版块继承</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="m" items="${moderators }" varStatus="status">
								<tr>
									<td>${m.displayOrder }</td>
									<td>${m.username }</td>
									<td>版主 </td>
									<td><c:choose><c:when test="${m.inherited == 1 }">是</c:when><c:otherwise>否</c:otherwise></c:choose></td>
									<td><a href="javascript:del('${m.forumId }','${m.username }')"  >删除</a></td>
								</tr>
							</c:forEach>
							
							<tr>
								
								<td><input type="hidden" name="forumId" value="${forum.forumId }">
									<input type="text" name="displayOrder"  value="0"></td>
								<td><input type="text" name="username"  check-type="required"
										required-message="请输入用户名"></td>
								<td><input type="text" value="版主"></td>
								<td>
									<div class="controls">
									<label class="radio inline">
									  <input type="radio" name="inherited" id="optionsRadios1" value="1">
										  是
									</label>
									<label class="radio inline">
									  <input type="radio" name="inherited" id="optionsRadios2" value="0" checked >
									  	否
									</label>
									</div>
								</td>
								<td><button type="submit" class="btn">添加</button></td>
								
							</tr>
							
						</tbody>
						
					</table>
					</form>
				</div>
			</div>
			<!--/span-->

		</div>
	</div>
	<!--/row-->
</body>

<jsp:include page="../frame/scripts.jsp"></jsp:include>
<script type="text/javascript">
$(document).ready(function(){
	
	$("#myform").validation();
	
	//保存
	$('#saveBtn').click(function(){
		$("#myform").submit();
	})
	
})
function del(forumId,username){
	if(confirm("确定要删除吗？")){
		window.location.href = '<c:url value="/admin/forum/delModerator"/>?forumId='+forumId+'&username='+username;	
	}
}


</script>